// 门派表
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;
// Create Schema
const SchoolSchema = new Schema({
  name: {
    type: String,
    required: true
  },
  leader: { // 首领
    type: ObjectId,
    ref: "npcs",
    require: true
  },
  join_exp: {
    type: Number,
    required: true,
    default: 0,
  },
  join_money: {
    type: Number,
    required: true,
    default: 0,
  },
  join_str: {
    type: Number,
    required: true,
    default: 0,
  },
  join_def: {
    type: Number,
    required: true,
    default: 0,
  },
  join_mag: {
    type: Number,
    required: true,
    default: 0,
  },
  join_spd: {
    type: Number,
    required: true,
    default: 0,
  },
  join_max_hp: { // 当前生命值
    type: Number,
    required: true,
    default: 0
  },
  created_at: {     //创建时间
    type: Date,
    default: Date.now()
  },
});

module.exports = School = mongoose.model('schools', SchoolSchema);
